package com.itheima.hotel.view;

import com.itheima.hotel.service.HotelMgtSystem;
import com.itheima.hotel.service.UserLogin;
import com.itheima.hotel.service.impl.HotelMgtSystemImpl;
import com.itheima.hotel.service.impl.HotelMgtSystemImpl2;
import com.itheima.hotel.service.impl.HotelMgtSystemImpl3;
import com.itheima.hotel.service.login.UserLoginImpl;

import java.util.Scanner;

/*
用户界面
视图层
 */
public class View3 {
    HotelMgtSystem hotelMgtSystem3=new HotelMgtSystemImpl3();
    public void getView(){
        UserLogin userLogin=new UserLoginImpl();
        boolean loginFlag = userLogin.login();
        if (loginFlag==true){

            //********************************************
            while (true) {
                System.out.println("1. 查询所有房间信息\n" +
                        "2. 预订房间\n" +
                        "3. 退订房间\n" +
                        "4. 查看已预订房间\n" +
                        "5. 退出系统");
                Scanner scanner=new Scanner(System.in);
                int nums=scanner.nextInt();
                //------------------------------------------------------
                switch (nums){
                    case 2:
                        hotelMgtSystem3.reserveRoom();
                        break;
                    case 3:
                        hotelMgtSystem3.checkOut();
                        break;
                    case 1:
                        hotelMgtSystem3.printAllRooms();
                    case 4:
                        hotelMgtSystem3.printOderRooms();
                        break;
                    case 5:
                        System.out.println("成功退出系统");
                        return;
                    default:
                        System.out.println("请输入正确的功能编码");
                        break;
                }
//------------------------------------------------
            }
//***********************************

        }



    }

}
